home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1995 by Watcom International Corp. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of Watcom International Corp.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WDEF_HPP_INCLUDED
- #define _WDEF_HPP_INCLUDED
- #pragma once
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- // Include basic stuff...
-
- #ifndef _WDECL_HPP_INCLUDED
- #include "wdecl.hpp"
- #endif
-
- //
- // Get rid of conflicts...
- //
-
- #ifndef _WIN16
- #undef FindWindow
- #undef FindWindowEx
- #undef SendMessage
- #undef GetClassName
- #if defined( _UNICODE )
- #define FindWindow FindWindowW
- #define FindWindowEx FindWindowExW
- #define SendMessage SendMessageW
- #define GetClassName GetClassNameW
- #else
- #define FindWindow FindWindowA
- #define FindWindowEx FindWindowExA
- #define SendMessage SendMessageA
- #define GetClassName GetClassNameA
- #endif
- #endif
-
- //
- // Forward declarations for classes
- //
-
- class WObject;
- class WScrollBar;
-
- class WMessage;
- class WWindow;
- struct WInstance;
-
- //
- // General type definitions
- //
-
- #define LAST_32BIT 0xFFFFFFFF
- #define LAST_16BIT 0xFFFF
-
- #ifndef _INC_WINDOWS
- #define FAR __far
- #define NEAR __near
- typedef char FAR* LPSTR;
- typedef const char FAR* LPCSTR;
- #endif
- #ifdef _WIN16
- #define LAST_16TO32BIT 0xFFFF
- #ifndef _COMPOBJ_H_
- typedef int INT;
- typedef unsigned int UINT;
- typedef unsigned int *PUINT;
- typedef unsigned char UCHAR;
- typedef UCHAR *PUCHAR;
- typedef unsigned long ULONG;
- typedef ULONG *PULONG;
- typedef unsigned short USHORT;
- typedef short SHORT;
- typedef unsigned long DWORD;
- #endif
- typedef LPSTR LPTSTR;
- typedef LPCSTR LPCTSTR;
- #else
- #define LAST_16TO32BIT 0xFFFFFFFF
- #endif
-
- #if defined( _WIN16 ) && defined( _INC_WINDOWS )
- #define _WINDEF_
- #endif
-
- typedef unsigned long WDialogID;
- typedef unsigned long WNotifyInfo;
-
- #ifdef _WINDEF_
- #ifndef STRICT
- #error If you wish to include windows.h, you must add the line 'define STRICT' first
- #endif
- #endif
- #ifndef _WINDEF_
- #ifndef _WIN16
- typedef void * HANDLE;
- #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
- #else
- typedef const void NEAR* HANDLE;
- #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef const struct name##__ NEAR* name
- #endif
- DECLARE_HANDLE( HWND );
- DECLARE_HANDLE( HMENU );
- DECLARE_HANDLE( HDC );
- DECLARE_HANDLE( HBITMAP );
- DECLARE_HANDLE( HICON );
- typedef HICON HCURSOR;
- DECLARE_HANDLE( HBRUSH );
- DECLARE_HANDLE( HPEN );
- DECLARE_HANDLE( HFONT );
- DECLARE_HANDLE( HMETAFILE );
- DECLARE_HANDLE( HINSTANCE );
- typedef HANDLE HGLOBAL;
- typedef WDWord HIMC;
- #ifndef _WIN16
- DECLARE_HANDLE( HKL );
- #endif
- typedef HINSTANCE HMODULE;
- #ifndef _WIN16
- typedef HANDLE HDWP;
- #else
- DECLARE_HANDLE( HDWP );
- #endif
- #endif
- #ifndef _INC_COMMCTRL
- #ifndef _WIN16
- struct _IMAGELIST;
- typedef struct _IMAGELIST near * HIMAGELIST;
- #else
- struct _PBIMAGELIST;
- typedef struct _PBIMAGELIST far * HIMAGELIST;
- #endif
- #endif
-
- typedef HDWP WDeferMoveHandle;
- #define NULLHDWP (WDeferMoveHandle)0
- #define LASTHDWP (WDeferMoveHandle)LAST_16TO32BIT
-
- typedef HWND WWindowHandle;
- #define NULLHWND (WWindowHandle)0
- #define LASTHWND (WWindowHandle)LAST_16TO32BIT
-
- typedef HMENU WMenuHandle;
- #define NULLHMNU (WMenuHandle)0
- #define LASTHMNU (WMenuHandle)LAST_16TO32BIT
-
- typedef HDC WDeviceHandle;
- #define NULLHDEV (WDeviceHandle)0
- #define LASTHDEV (WDeviceHandle)LAST_16TO32BIT
-
- typedef HBITMAP WBitmapHandle;
- #define NULLHBMP (WBitmapHandle)0
- #define LASTHBMP (WBitmapHandle)LAST_16TO32BIT
-
- typedef HICON WIconHandle;
- #define NULLHICON (WIconHandle)0
- #define LASTHICON (WIconHandle)LAST_16TO32BIT
-
- typedef HCURSOR WCursorHandle;
- #define NULLHCURSOR (WCursorHandle)0
- #define LASTHCURSOR (WCursorHandle)LAST_16TO32BIT
-
- typedef HBRUSH WBrushHandle;
- #define NULLHBRUSH (WBrushHandle)0
- #define LASTHBRUSH (WBrushHandle)LAST_16TO32BIT
-
- typedef HPEN WPenHandle;
- #define NULLHPEN (WPenHandle)0
- #define LASTHPEN (WPenHandle)LAST_16TO32BIT
-
- typedef HFONT WFontHandle;
- #define NULLHFONT (WFontHandle)0
- #define LASTHFONT (WFontHandle)LAST_16TO32BIT
-
- typedef HMETAFILE WMetafileHandle;
- #define NULLHMF (WMetafileHandle)0
- #define LASTHMF (WMetafileHandle)LAST_16TO32BIT
-
- typedef HMODULE WModuleHandle;
- #define NULLHMODULE (WModuleHandle)0
- #define LASTHMODULE (WModuleHandle)LAST_16TO32BIT
-
- typedef HGLOBAL WMemoryHandle;
- #define NULLHMEM (WMemoryHandle)0
- #define LASTHMEM (WMemoryHandle)LAST_16TO32BIT
-
- typedef HKL WKeyboardHandle;
- #define NULLHKL (WKeyboardHandle)0
- #define LASTHKL (WKeyboardHandle)LAST_16TO32BIT
-
- typedef HIMC WInputContextHandle;
- #define NULLHIMC (WInputContextHandle)0;
- #define LASTHIME (WInputContextHanlde)LAST_16TO32BIT
-
- typedef HIMAGELIST WImageListHandle;
- #define NULLHIMAGELIST (WImageListHandle)0
- #define LASTHIMAGELIST (WImageListHandle)LAST_16TO32BIT
-
- enum WNotify { NULLNOTIFY = 0, LASTNOTIFY = LAST_16BIT };
- enum WCallbackProc { NULLCALLBACK = 0, LASTCALLBACK = LAST_32BIT };
-
- #ifndef CALLBACK
- #if defined( __NT__ )
- #define CALLBACK __stdcall
- #else
- #define CALLBACK __far __pascal
- #endif
- #endif
- #ifndef WINAPI
- #if defined( __NT__ )
- #define WINAPI __stdcall
- #else
- #define WINAPI __far __pascal
- #endif
- #endif
-
- //
- // _ApplicationModule
- //
- // This global variable must be defined by any program that uses
- // classes that require resources.
-
- extern WModuleHandle _ApplicationModule;
-
-
- typedef struct WInstance * WINSTANCE;
-
- class WWindow;
-
- class WCMCLASS WRange {
-
- public:
-
- /***************************************************************
- * Constructors and Destructors
- ***************************************************************/
-
- WRange();
- WRange( WInt s, WInt e );
- WRange( const WRange & r );
-
- ~WRange();
-
- /***************************************************************
- * Properties
- ***************************************************************/
-
- WInt GetDistance() const;
-
- /***************************************************************
- * Methods
- ***************************************************************/
-
- WBool AboveRange( WInt i ) const;
-
- WBool BelowRange( WInt i ) const;
-
- WBool InsideRange( WInt i ) const;
-
- /***************************************************************
- * Data Members
- ***************************************************************/
-
- WInt start;
- WInt end;
- };
-
- enum WStyle { NULLWSTYLE = 0, LASTWSTYLE = LAST_32BIT };
-
- inline WStyle operator|( WStyle lhs, WStyle rhs )
- { return (WStyle)((unsigned long)lhs | (unsigned long)rhs); }
-
- inline WStyle operator&( WStyle lhs, WStyle rhs )
- { return (WStyle)((unsigned long)lhs & (unsigned long)rhs); }
-
- inline WStyle operator~( WStyle style )
- { return (WStyle)(~(unsigned long)style); }
-
- inline WStyle & operator|=( WStyle & lhs, WStyle rhs )
- { lhs = (WStyle)((unsigned long)lhs | (unsigned long)rhs); return lhs; }
-
- inline WStyle & operator&=( WStyle & lhs, WStyle rhs )
- { lhs = (WStyle)((unsigned long)lhs & (unsigned long)rhs); return lhs; }
-
- #ifndef _WCHAR_HPP_INCLUDED
- # include "wchar.hpp"
- #endif
- #ifndef _WBASECL_HPP_INCLUDED
- # include "wbasecl.hpp"
- #endif
- #ifndef _WMEMORY_HPP_INCLUDED
- # include "wmemory.hpp"
- #endif
- #ifndef _WDEBUG_HPP_INCLUDED
- # include "wdebug.hpp"
- #endif
-
- inline long WMin( long a, long b ) { return (a<b) ? a : b; }
- inline long WMax( long a, long b ) { return (a>b) ? a : b; }
- inline long WAbs( long a ) { return (a<0) ? -a : a; }
-
- extern unsigned long WProcessID;
- extern WBool WDraggingMode;
-
- enum WShowStyle {
- WWinStateHide = 0,
- WWinStateShowNormal = 1,
- WWinStateNormal = WWinStateShowNormal,
- WWinStateMinimized = 2,
- WWinStateShowMinimized = WWinStateMinimized,
- WWinStateMaximized = 3,
- WWinStateShowMaximized = WWinStateMaximized,
- WWinStateMaximize = WWinStateMaximized,
- WWinStateShowNoActivate = 4,
- WWinStateShow = 5,
- WWinStateMinimize = 6,
- WWinStateShowMinNoActivate = 7,
- WWinStateShowNA = 8,
- WWinStateShowRestore = 9,
- WWinStateShowDefault = 10,
- WWinStateMax = WWinStateShowDefault
- };
-
- // ------ Scrollbar Definitions ------- //
-
- enum WScrollMessage {
- WLineUp = 0,
- WLineLeft = WLineUp,
- WLineDown = 1,
- WLineRight = WLineDown,
- WPageUp = 2,
- WPageLeft = WPageUp,
- WPageDown = 3,
- WPageRight = WPageDown,
- WPosition = 4,
- WTrack = 5,
- WTop = 6,
- WLeft = WTop,
- WBottom = 7,
- WRight = WBottom,
- WEndScroll = 8,
- };
-
- enum WScrollDir {
- WScrollHorizontal = 0,
- WScrollVertical = 1,
- };
-
- enum WMouseFlagValues {
- WMKNone = 0x0000,
- WMKLeftDown = 0x0001,
- WMKLeftButton = WMKLeftDown,
- WMKRightDown = 0x0002,
- WMKRightButton = WMKRightDown,
- WMKShift = 0x0004,
- WMKControl = 0x0008,
- WMKMiddleDown = 0x0010,
- WMKMiddleButton = WMKMiddleDown,
- WMKAlt = 0x0020
- };
- typedef WULong WMouseFlags;
-
- #define WClass_SendMessage(type,msg,wp,lp) \
- (type)SendMessage(WMessage(msg,wp,lp))
-
- #define inline_win32 inline
- #define inline_win inline
- #define inline_win16
- #define inline_os2
-
- #if defined( DECLARE_HANDLE )
- typedef HWND _WHWND;
- #else
- typedef void *_WHWND;
- #endif
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WDEF_HPP_INCLUDED
-